<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//后台登录页面
Route::get('/admin/login','Admin\LoginController@login');
Route::post('/admin/checkLogin','Admin\LoginController@checkLogin');

//建立后台路由
Route::group(['middleware'=>'login'],function(){
    //退出登录
    Route::get('/admin/logout','Admin\LoginController@logout');
	//后台首页
	Route::get('/admin/index','Admin\IndexController@index');

    /** 用户相关操作开始 **/
	//添加用户界面
	Route::get('/admin/user/add','Admin\UserController@add');
    //添加用户操作
    Route::post('/admin/user/insert','Admin\UserController@insert');
	//用户列表
	Route::get('/admin/user/index','Admin\UserController@index');
    //删除用户操作
    Route::get('/admin/user/delete','Admin\UserController@delete');
    //更新用户界面方法
    Route::get('/admin/user/modify','Admin\UserController@modify');
    //更新用户界面
    Route::post('/admin/user/update','Admin\UserController@update');
    //查找用户界面
    Route::get('/admin/user/find','Admin\UserController@find');
    //查找用户操作
    Route::get('/admin/user/search','Admin\UserController@search');
    /** 用户相关操作结束 **/

    /** 商品类型相关操作开始 **/
    //商品类型列表
    Route::get('/admin/goodtype/index','Admin\GoodtypeController@index');
    //删除商品类型
    Route::get('/admin/goodtype/delete','Admin\GoodtypeController@delete');
    //更新商品类型方法
    Route::get('/admin/goodtype/modify','Admin\GoodtypeController@modify');
    //更新商品类型界面
    Route::post('/admin/goodtype/update','Admin\GoodtypeController@update');
    //添加商品类型界面
    Route::get('/admin/goodtype/add','Admin\GoodtypeController@add');
    //添加商品类型操作
    Route::post('/admin/goodtype/insert','Admin\GoodtypeController@insert');
    //查找商品类型界面
    Route::get('/admin/goodtype/find','Admin\GoodtypeController@find');
    //查找商品类型操作
    Route::get('/admin/goodtype/search','Admin\GoodtypeController@search');
    /** 商品类型相关操作结束 **/

    /** 商品相关操作开始 **/
    //商品列表
    Route::get('/admin/goods/index','Admin\GoodsController@index');
    //删除商品
    Route::get('/admin/goods/delete','Admin\GoodsController@delete');
    //更新商品方法
    Route::get('/admin/goods/modify','Admin\GoodsController@modify');
    //更新商品界面
    Route::post('/admin/goods/update','Admin\GoodsController@update');
    //添加商品界面
    Route::get('/admin/goods/add','Admin\GoodsController@add');
    //添加商品操作
    Route::post('/admin/goods/insert','Admin\GoodsController@insert');
    //查找商品界面
    Route::get('/admin/goods/find','Admin\GoodsController@find');
    //查找商品操作
    Route::get('/admin/goods/search','Admin\GoodsController@search');
    //查找库存界面
    Route::get('/admin/goods/stockfind','Admin\GoodsController@stockfind');
    //查找库存操作
    Route::get('/admin/goods/stocksearch','Admin\GoodsController@stocksearch');
    /** 商品相关操作结束 **/

});

//前台登录
Route::get('/home/login','Home\LoginController@login');
//前台验证登录
Route::post('/home/checkLogin','Home\LoginController@checkLogin');
//退出登录
Route::get('/home/logout','Home\LoginController@logout');

//前台注册
Route::get('/home/reg','Home\RegController@reg');
//前台验证注册
Route::post('/home/checkReg','Home\RegController@checkReg');

//建立前台路由
Route::group([],function(){
	//主页
	Route::get('/home/index','Home\IndexController@index');
	
	//个人中心
	Route::get('/home/personal/personal','Home\PersonalController@personal');
	
	//个人详细信息
	Route::get('/home/personal/information','Home\InformationController@information');
	
	//修改头像
	Route::get('/home/personal/modify','Home\ModifyController@modify');
	
	//修改密码
	Route::get('/home/personal/password','Home\PasswordController@password');
	
	//所有订单
	Route::get('/home/personal/order','Home\OrderController@order');
	
	//待付款
	Route::get('/home/personal/pay','Home\PayController@pay');
	
	//待发货
	Route::get('/home/personal/send','Home\SendController@send');
	
	//待收货
	Route::get('/home/personal/receive','Home\receiveController@receive');
	
	//待评价
	Route::get('/home/personal/comment','Home\CommentController@comment');
	
	//收货地址
	Route::get('/home/personal/address','Home\AddressController@address');
	
	//我的收藏
	Route::get('/home/personal/collect','Home\CollectController@collect');
	
    //退换货
	Route::get('/home/personal/refund','Home\RefundController@refund');
	
    //以旧换新
	Route::get('/home/personal/news','Home\NewsController@news');
	
	//我的乐豆
	Route::get('/home/personal/beanfun','Home\BeanfunController@beanfun');
	
});
